home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / emacssrc.zip / EMACSSRC.TAR / emacs-19.17 / src / dispextern.h < prev    next >
C/C++ Source or Header  |  1993-10-06  |  4KB  |  142 lines

  1. /* Interface definitions for display code.
  2.    Copyright (C) 1985, 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU Emacs.
  5.  
  6. GNU Emacs is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU Emacs is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU Emacs; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* Nonzero means last display completed and cursor is really at
  21.    cursX, cursY.  Zero means it was preempted. */
  22. extern int display_completed;
  23.  
  24. #ifdef HAVE_X_WINDOWS
  25. #include <X11/Xlib.h>
  26.  
  27. struct face
  28.   {
  29.     /* If this is non-zero, it is a GC we can use without modification
  30.        to represent this face.  */
  31.     GC gc;
  32.  
  33.     /* If we have ever called get_cached_face on this face structure,
  34.        here is the index in face_vector of the face it returned.  It
  35.        might not be valid any more, but it's a good place to start
  36.        looking; get_cached_face tries to use this to avoid searching
  37.        all of face_vector.  */
  38.     int cached_index;
  39.   
  40.     /* Pixel value for foreground color.  */
  41.     int foreground;
  42.   
  43.     /* Pixel value for background color.  */
  44.     int background;
  45.   
  46.     /* Font used for this face.  */
  47.     XFontStruct *font;
  48.   
  49.     /* Background stipple or bitmap used for this face.  */
  50.     Pixmap stipple;
  51.  
  52.     /* Pixmap_depth.  */
  53.     unsigned int pixmap_w, pixmap_h;
  54.   
  55.     /* Whether or not to underline text in this face.  */
  56.     char underline;
  57.   };
  58.  
  59. /* Let's stop using this and get rid of it.  */
  60. typedef struct face *FACE;
  61.  
  62. #define NORMAL_FACE ((struct face *) 0)
  63.  
  64. #define FACE_HAS_GC(f) ((f)->gc)
  65. #define FACE_GC(f) ((f)->gc)
  66. #define FACE_FOREGROUND(f) ((f)->foreground)
  67. #define FACE_BACKGROUND(f) ((f)->background)
  68. #define FACE_FONT(f) ((f)->font)
  69. #define FACE_STIPPLE(f) ((f)->stipple)
  70. #define FACE_UNDERLINE_P(f) ((f)->underline)
  71.  
  72. #else  /* Not X */
  73.  
  74. typedef int FACE;
  75.  
  76. #define NORMAL_FACE 0x0
  77. #define HIGHLIGHT_FACE 0x1
  78. #define UNDERLINE_FACE 0x2
  79. #define HIGHLIGHT_UNDERLINE_FACE 0x3
  80.  
  81. #define FACE_HIGHLIGHT(f) ((f) & 0x1)
  82. #define FACE_UNDERLINE(f) ((f) & 0x2)
  83. #endif /* Not X */
  84.  
  85.  
  86. /* This structure is used for the actual display of text on a frame.
  87.  
  88.    There are two instantiations of it:  the glyphs currently displayed,
  89.    and the glyphs we desire to display.  The latter object is generated
  90.    from buffers being displayed.  */
  91.  
  92. struct frame_glyphs
  93.   {
  94. #ifdef MULTI_FRAME
  95.     struct  frame *frame;    /* Frame these glyphs belong to.  */
  96. #endif /* MULTI_FRAME */
  97.     int height;
  98.     int width;
  99.  
  100.     /* Contents of the frame.
  101.        glyphs[V][H] is the glyph at position V, H.
  102.        Note that glyphs[V][-1],
  103.                  glyphs[V][used[V]],
  104.          and glyphs[V][frame_width] are always '\0'.  */
  105.     GLYPH **glyphs;
  106.     /* long vector from which the strings in `glyphs' are taken.  */
  107.     GLYPH *total_contents;
  108.  
  109.     /* When representing a desired frame,
  110.          enable[n] == 0 means that line n is same as current frame.
  111.      Between updates, all lines should be disabled.
  112.        When representing current frame contents,
  113.          enable[n] == 0 means that line n is blank.  */
  114.     char *enable;
  115.  
  116.     /* Everything on line n after column used[n] is considered blank.  */
  117.     int *used;
  118.  
  119.     /* highlight[n] != 0 iff line n is highlighted.  */
  120.     char *highlight;
  121.  
  122.     /* Buffer offset of this line's first char.  */
  123.     int   *bufp;
  124.  
  125. #ifdef HAVE_X_WINDOWS
  126.     /* Pixel position of top left corner of line.  */
  127.     short *top_left_x;
  128.     short *top_left_y;
  129.  
  130.     /* Pixel width of line.  */
  131.     short *pix_width;
  132.  
  133.     /* Pixel height of line.  */
  134.     short *pix_height;
  135.  
  136.     /* Largest font ascent on this line.  */
  137.     short *max_ascent;
  138. #endif    /* HAVE_X_WINDOWS */
  139.   };
  140.  
  141. #include "dispnew_p.h"
  142.